# New ASM File
phase_zero_intro:
.asciiz "\nWelcome to Computer Architecture. Here is the final exam."

question_one:
.asciiz "\nQuestion 1: what is computer architecture?"

question_one_answer:
.asciiz "\n1. It depends. \n2. What do YOU think? \n3. Designing buildings with computers."

question_two:
.asciiz "\nQuestion 2: What is a processor?"
question_two_answer:
.asciiz "\n1. It depends. \n2. The heart of the computer. \n3. You use it to chop up food."

question_three:
.asciiz "\nHow many lights are there?"

question_three_answer:
.asciiz "\n1. THERE. ARE. FOUR. LIGHTS. \n2. It depends. \n3. 42,"

question_four:
.asciiz "\nBrengsek!"
question_four_answer:
.asciiz "\n1. It depends. \n2. Wira \n3. Fritz"

question_five:
.asciiz "\nUmmmmm?"
question_five_answer:
.asciiz "\n1. It... um... depends... \n2. umm \n3. ummm"

phase_zero_begin:
	#set playerlevel = 1
	li $t0, 0x00000001
	move $s7, $t0
	li $a0, phase_zero_intro
	jal libplp_uart_write_string
	nop
	li $a0, question_one
	jal libplp_uart_write_string
	nop
	li $a0, question_one_answer
	jal libplp_uart_write_string
	nop
	jal libplp_uart_read
	nop
	jal check_answer
	nop
	j question_two_ask
	nop

question_two_ask:
	li $a0, question_two
	jal libplp_uart_write_string
	nop
	li $a0, question_two_answer
	jal libplp_uart_write_string
	nop
	jal libplp_uart_read
	nop
	jal check_answer
	nop
	j question_three_ask
	nop
question_three_ask:
	li $a0, question_three
	jal libplp_uart_write_string
	nop
	li $a0, question_three_answer
	jal libplp_uart_write_string
	nop
	jal libplp_uart_read
	nop
	jal check_answer
	nop
	j question_four_ask
	nop

question_four_ask:
	li $a0, question_four
	jal libplp_uart_write_string
	nop
	li $a0, question_four_answer
	jal libplp_uart_write_string
	nop
	jal libplp_uart_read
	nop
	jal check_answer
	nop
	j question_five_ask
	nop

question_five_ask:
	li $a0, question_five
	jal libplp_uart_write_string
	nop
	li $a0, question_five_answer
	jal libplp_uart_write_string
	nop
	jal libplp_uart_read
	nop
	jal check_answer
	nop
	j phase_one_begin
	nop

check_answer:
	move $t0, $v0
	li $t1, 0x00000031
	beq $t0, $t1, answer_correct
	nop
	j quizfail
	nop
answer_correct:
	jr $31
	nop